#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
sbit beep=P2^3;
sbit led0=P1^0;
sbit led1=P1^1;
uchar time;
void delayms(uint xms)
{
	uint i,j;
	for(i=xms;i>0;i--)
	for(j=110;j>0;j--);
}
void main()
{
	EA=1;
	IT1=1;
	IT0=1;
	EX0=1;
	EX1=1;
	while(1)
	{
		led0=1;
		led1=0;
	}
}
void warn1()
{
	EX0=0;
	for(time=0;time<10;time++)
	{
		beep=0;
		led0=1;
		delayms(500);
		led0=0;
		beep=1;
		delayms(500);
	}
	EX0=1;
}
void warn2()
{
	EX1=0;
	for(time=0;time<10;time++)
	{
		beep=0;
		led0=1;
		delayms(500);
		led0=0;
		beep=1;
		delayms(500);
	}
	EX1=1;
}
